<template>
  <b class="curBox">Tab one</b>
</template>
<script setup>
import { onActivated, onDeactivated } from 'vue'
// 方法一命名
defineOptions({ name: 'OneTab' })
onActivated(() => {
  console.log('one 被激活')
})
onDeactivated(() => {
  console.log('one 被缓存')
})
</script>
<!-- 方法二 -->
<!-- <script>
export default {
  name: 'OneTab', //必须设置name,才能被keep-alive正确识别
}
</script> -->
<style>
.curBox {
  cursor: pointer;
}
</style>
